Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read the imgsz parameter in metadata #8

Merged
merged 3 commits into from
Apr 10, 2024
Merged

Read the imgsz parameter in metadata #8

merged 3 commits into from
Apr 10, 2024

Conversation

x2031
Copy link
Contributor

@x2031 x2031 commented Apr 8, 2024

Dynamically adjust the imgsz in the prediction process by reading the imgsz parameter in the metadata file.

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Enhancements in model input size flexibility and label loading for the YOLO Flutter App.

📊 Key Changes

  • Introduced variability in INPUT_SIZE to accommodate different model input sizes.
  • Added support for loading custom label sizes from the model metadata.

🎯 Purpose & Impact

  • Adaptable Model Support: The app can now support YOLO models with different input sizes, making it more flexible for various use cases. 🔄
  • Enhanced Label Handling: By loading label sizes directly from the model's metadata, the app ensures that labels are accurately matched with the detected objects, improving detection accuracy and user experience. 🏷️

These changes aim to make the YOLO Flutter app more versatile and user-friendly, catering to a wider range of models and detection scenarios.

@pderrenger
Copy link
Member

pderrenger commented Apr 9, 2024

Hi there! 👋

Thank you for reaching out! If you're looking to dynamically adjust imgsz based on the metadata, you might consider doing this right before your prediction call. Assuming your metadata is in a readable format like JSON, you could do something like this:

import json

# Assuming 'metadata.json' contains {'imgsz': 640}
with open('metadata.json') as f:
    metadata = json.load(f)

# Update imgsz
imgsz = metadata['imgsz']

# Now, proceed to use imgsz in your prediction settings

This snippet reads the imgsz from a metadata.json file, allowing you to then utilize this size in your prediction workflow. Keep the operation outside critical performance paths to ensure efficiency.

For more info on managing prediction configurations, please visit our documentation at https://docs.ultralytics.com.

Hope that helps! Let the community know if you have further questions. 😊

@glenn-jocher glenn-jocher requested a review from sergiossm April 9, 2024 10:06
Copy link

github-actions bot commented Apr 9, 2024

CLA Assistant Lite bot All Contributors have signed the CLA. ✅

@x2031
Copy link
Contributor Author

x2031 commented Apr 9, 2024

I have read the CLA Document and I sign the CLA

@sergiossm sergiossm merged commit f4003f7 into ultralytics:main Apr 10, 2024
2 checks passed
Copy link
Contributor

@sergiossm sergiossm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants